﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;
using Wix.Aura.Common.CustomTypes;

namespace Wix.Aura.Common {
	public class Permission : IXmlSerializable {
		private Permission() { }
		public Permission(string user) {
			User = user;
		}
			
		public YesNoType Append { get; set; }
		public YesNoType ChangePermission { get; set; }
		public YesNoType CreateChild { get; set; }
		public YesNoType CreateFile { get; set; }
		public YesNoType CreateLink { get; set; }
		public YesNoType CreateSubkeys { get; set; }
		public YesNoType Delete { get; set; }
		public YesNoType DeleteChild { get; set; }
		public string Domain { get; set; }
		public YesNoType EnumerateSubkeys { get; set; }
		public YesNoType Execute { get; set; }
		public YesNoType FileAllRights { get; set; }
		public YesNoType GenericAll { get; set; }
		public YesNoType GenericExecute { get; set; }
		public YesNoType GenericRead { get; set; }
		public YesNoType GenericWrite { get; set; }
		public YesNoType Notify { get; set; }
		public YesNoType Read { get; set; }
		public YesNoType ReadAttributes { get; set; }
		public YesNoType ReadExtendedAttributes { get; set; }
		public YesNoType ReadPermission { get; set; }
		public YesNoType SpecificRightsAll { get; set; }
		public YesNoType Synchronize { get; set; }
		public YesNoType TakeOwnership { get; set; }
		public YesNoType Traverse { get; set; }
		public string User { get; set; }
		public YesNoType Write { get; set; }
		public YesNoType WriteAttributes { get; set; }
		public YesNoType WriteExtendedAttributes { get; set; }

		public System.Xml.Schema.XmlSchema GetSchema() {
			throw new NotImplementedException();
		}

		public void ReadXml(System.Xml.XmlReader reader) {
			throw new NotImplementedException();
		}

		public void WriteXml(System.Xml.XmlWriter writer) {
			writer.WriteStartElement("Permission");
			writer.WriteAttribute("Append", Append);
			writer.WriteAttribute("ChangePermission", ChangePermission);
			writer.WriteAttribute("CreateChild", CreateChild);
			writer.WriteAttribute("CreateFile", CreateFile);
			writer.WriteAttribute("CreateLink", CreateLink);
			writer.WriteAttribute("CreateSubkeys", CreateSubkeys);
			writer.WriteAttribute("Delete", Delete);
			writer.WriteAttribute("DeleteChild", DeleteChild);
			writer.WriteAttribute("Domain", Domain);
			writer.WriteAttribute("EnumerateSubkeys", EnumerateSubkeys);
			writer.WriteAttribute("Execute", Execute);
			writer.WriteAttribute("FileAllRights", FileAllRights);
			writer.WriteAttribute("GenericAll", GenericAll);
			writer.WriteAttribute("GenericExecute", GenericExecute);
			writer.WriteAttribute("GenericRead", GenericRead);
			writer.WriteAttribute("GenericWrite", GenericWrite);
			writer.WriteAttribute("Notify", Notify);
			writer.WriteAttribute("Read", Read);
			writer.WriteAttribute("ReadAttributes", ReadAttributes);
			writer.WriteAttribute("ReadExtendedAttributes", ReadExtendedAttributes);
			writer.WriteAttribute("ReadPermission", ReadPermission);
			writer.WriteAttribute("SpecificRightsAll", SpecificRightsAll);
			writer.WriteAttribute("Synchronize", Synchronize);
			writer.WriteAttribute("TakeOwnerShip", TakeOwnership);
			writer.WriteAttribute("Traverse", Traverse);
			writer.WriteAttribute("User", User);
			writer.WriteAttribute("Write", Write);
			writer.WriteAttribute("WriteAttributes", WriteAttributes);
			writer.WriteAttribute("WriteExtendedAttributes", WriteExtendedAttributes);
			writer.WriteEndElement();
		}
	}
}
